package com.tedu.demo;

public class Test01_Inter {
    public static void main(String[] args) {
        new Inter(){

            @Override
            public void save() {
                System.out.println("保存成功");
            }

            @Override
            public void delete(int id) {
                System.out.println("数据删除成功" + id);
            }
        }.save();
        Inter in = new Inter(){

            @Override
            public void save() {
                System.out.println("保存成功");
            }

            @Override
            public void delete(int id) {
                System.out.println("数据删除成功" + id);
            }
        };
        in.save();
        in.delete(10);
    }
}
abstract class Inter{
    abstract public void save();
    abstract public void delete(int id);
}
